﻿<Window x:Class="ConsoleHoster.View.Popups.FontsView"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:vm="clr-namespace:ConsoleHoster.ViewModel"
        xmlns:uc="clr-namespace:ConsoleHoster.Common.Controls;assembly=ConsoleHoster.Common"
        xmlns:cv="clr-namespace:ConsoleHoster.View.Converters"
        Title="Font settings" ResizeMode="NoResize" SizeToContent="WidthAndHeight" ShowInTaskbar="False" Style="{DynamicResource PopupStyle}" WindowStartupLocation="CenterOwner" Loaded="Window_Loaded">
    <Window.Resources>
        <BooleanToVisibilityConverter x:Key="cvBooleanToVisibilityConverter"/>
    </Window.Resources>
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition />
            <RowDefinition />
            <RowDefinition />
        </Grid.RowDefinitions>

        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <ComboBox ItemsSource="{Binding Path=FontFamilies}" SelectedValue="{Binding Path=SelectedFont, Mode=TwoWay}">
                <ComboBox.ItemTemplate>
                    <DataTemplate>
                        <TextBlock Text="{Binding}" FontFamily="{Binding}" />
                    </DataTemplate>
                </ComboBox.ItemTemplate>
            </ComboBox>
            <uc:WaitIndicator Height="15" Width="15" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Margin="3, 0, 0, 0" Grid.Column="1"  Visibility="{Binding Path=IsBusy, Converter={StaticResource ResourceKey=cvBooleanToVisibilityConverter}}"/>
        </Grid>

        <CheckBox Content="Use bold font" IsChecked="{Binding Path=UseBoldFont, Mode=TwoWay}" Grid.Row="1" Margin="0, 2, 0, 0" />

        <StackPanel Orientation="Horizontal" Grid.Row="2" HorizontalAlignment="Center" Margin="0, 5, 0, 0">
            <Button x:Name="btnSave" Content="Save" Width="100" Click="btnSave_Click" Cursor="Hand" />
            <Button x:Name="btnCancel" Content="Cancel" Width="100" Margin="3, 0, 0, 0" Click="btnCancel_Click" Cursor="Hand" />
        </StackPanel>
    </Grid>
</Window>
